﻿using System.Drawing;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Input;

namespace TouchControls.ControlHandlers
{
    public class RepeatButtonHandler : ElementHandler
    {
        public override void Tap(PointF global, PointF relative)
        {
            var c = Source as RepeatButton;
            if (c == null || !c.IsEnabled) return;
            var e = new RoutedEventArgs { RoutedEvent = ButtonBase.ClickEvent };
            c.RaiseEvent(e);
            base.Tap(global, relative);
        }
    }
}

